<template>
  <div>
    <el-card>
      <el-form class="search" :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch"
               @submit.native.prevent>
        <el-form-item label="料仓编号" prop="siloCode">
          <el-input
            v-model="queryParams.siloCode"
            placeholder="请输入料仓编号"
            clearable
            size="small"
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="物料名称" prop="matterName">
          <el-input
            v-model="queryParams.matterName"
            placeholder="请输入物料名称"
            clearable
            size="small"
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item>
          <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
          <el-button style="font-size: 1em;width: 120px;margin-top: 0px;height: 40px" type="primary"
                     @click="soilClick(2)"
                     class="">仓重记录
          </el-button>
          <el-button style="font-size: 1em;width: 120px;margin-top: 0px;height: 40px" type="primary"
                     @click="soilClick(3)"
                     class="">下料量记录
          </el-button>
          <el-button style="font-size: 1em;width: 120px;margin-top: 0px;height: 40px" type="primary"
                     @click="soilClick(4)"
                     class="">当日生产统计
          </el-button>
        </el-form-item>
      </el-form>

      <tr>
        <td style="width: 200px">设定总量：{{ setSum }}</td>
        <td style="width: 200px">配比总和：{{ ratioSum }}</td>
        <td style="width: 300px">联动状态仓配比总和：{{ linRatioSum }}</td>
        <td style="width: 200px">瞬时量总和：{{ insSum }}</td>
      </tr>


      <el-table v-loading="loading" :data="silo2List" border @selection-change="handleSelectionChange">
        <!--<el-table-column type="selection" width="55" align="center" />-->
        <el-table-column label="料仓编号" align="center" prop="siloCode"/>
        <el-table-column label="物料名称" align="center" prop="matterName"/>
        <el-table-column label="仓重" align="center" prop="weightCode"/>
        <el-table-column label="实际下料量" align="center" prop="cuttingCode"/>
        <el-table-column label="设定下料量" align="center" prop="setCode"/>
        <el-table-column label="下料量偏差" align="center" prop="pianchaCode"/>
        <el-table-column label="频率" align="center" prop="frequencyCode"/>
        <el-table-column label="配比" align="center" prop="peibiCode"/>
        <el-table-column label="前日日累计量" align="center" prop="preAdayCode"/>
        <el-table-column label="当日夜班" align="center" prop="accunCode"/>
        <el-table-column label="当日白班" align="center" prop="accudCode"/>
        <el-table-column label="当日中班" align="center" prop="midCode"/>
        <el-table-column label="当日日累积" align="center" prop="totalCode"/>
        <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120">
          <template slot-scope="scope">
            <el-button
              size="mini"
              type="text"
              icon="el-icon-refresh"
              @click="handleWare(scope.row)"
              v-hasPermi="['demo:silo:cut']"
            >下料量
            </el-button>
            <el-button
              size="mini"
              type="text"
              icon="el-icon-refresh"
              @click="handleCut(scope.row)"
              v-hasPermi="['demo:silo:ware']"
            >仓重
            </el-button>
<!--            <el-button-->
<!--              size="mini"-->
<!--              type="text"-->
<!--              icon="el-icon-edit"-->
<!--              @click="handleUpdate(scope.row)"-->
<!--              v-hasPermi="['demo:silo:edit']"-->
<!--            >修改-->
<!--            </el-button>-->
<!--            <el-button-->
<!--              size="mini"-->
<!--              type="text"-->
<!--              icon="el-icon-delete"-->
<!--              @click="handleDelete(scope.row)"-->
<!--              v-hasPermi="['demo:silo:remove']"-->
<!--            >删除-->
<!--            </el-button>-->
          </template>
        </el-table-column>
      </el-table>

      <pagination
        v-show="total>0"
        :total="total"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        @pagination="getList"
      />

      <el-dialog :visible.sync="lcxll" width="60%" append-to-body>
        <el-form :model="queryParams" ref="queryForm" :inline="true">
          <el-form-item label="时间范围" prop="searchDateRange">
            <el-date-picker clearable size="small"
                            @change="drawChuteChart(silo)"
                            v-model="query2Params.searchDateRange"
                            type="datetimerange"
                            value-format="yyyy-MM-dd HH:mm:ss"
                            range-separator="至"
                            start-placeholder="开始时间"
                            end-placeholder="结束时间">
            </el-date-picker>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="drawChuteChart(silo)">搜索</el-button>
          </el-form-item>
        </el-form>
        <div ref="lcxllChart" style="width: 100%;height: 600px"></div>
      </el-dialog>

      <el-dialog :visible.sync="ssxll" width="60%" append-to-body>
        <el-form :model="queryParams" ref="queryForm" :inline="true">
          <el-form-item label="时间范围" prop="searchDateRange">
            <el-date-picker clearable size="small"
                            @change="drawCuttChart(silo)"
                            v-model="query2Params.searchDateRange"
                            type="datetimerange"
                            value-format="yyyy-MM-dd HH:mm:ss"
                            range-separator="至"
                            start-placeholder="开始时间"
                            end-placeholder="结束时间">
            </el-date-picker>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="drawCuttChart(silo)">搜索</el-button>
          </el-form-item>
        </el-form>
        <div ref="ssxllChart" style="width: 100%;height: 600px"></div>
      </el-dialog>


      <el-dialog title="料种" :visible.sync="lz" width="60%" append-to-body>
        <sinter-matter></sinter-matter>
      </el-dialog>


      <el-dialog title="仓重记录" :visible.sync="pbsd" width="80%" append-to-body>
        <el-form :model="queryParams" ref="queryForm" :inline="true">
          <el-form-item label="时间范围" prop="searchDateRange">
            <el-date-picker clearable size="small"
                            @change="draLczDataChart"
                            v-model="query2Params.searchDateRange"
                            type="datetimerange"
                            value-format="yyyy-MM-dd HH:mm:ss"
                            range-separator="至"
                            start-placeholder="开始时间"
                            end-placeholder="结束时间">
            </el-date-picker>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="draLczDataChart">搜索</el-button>
          </el-form-item>
        </el-form>
        <div ref="czjlChart" style="width: 100%;height: 600px"></div>
      </el-dialog>

      <el-dialog title="仓重记录" :visible.sync="pbsdCut" width="80%" append-to-body>
        <el-form :model="queryParams" ref="queryForm" :inline="true">
          <el-form-item label="时间范围" prop="searchDateRange">
            <el-date-picker clearable size="small"
                            @change="draLczDataChart"
                            v-model="query2Params.searchDateRange"
                            type="datetimerange"
                            value-format="yyyy-MM-dd HH:mm:ss"
                            range-separator="至"
                            start-placeholder="开始时间"
                            end-placeholder="结束时间">
            </el-date-picker>
          </el-form-item>
          <el-form-item>
            <!--<el-button type="primary" icon="el-icon-search" size="mini" @click="draLczDataChart">搜索</el-button>-->
          </el-form-item>
        </el-form>
        <div ref="czjlChartCut" style="width: 100%;height: 600px"></div>
      </el-dialog>

      <el-dialog title="下料量记录" :visible.sync="lcjllWare" width="80%" append-to-body>
        <el-form :model="queryParams" ref="queryForm" :inline="true">
          <el-form-item label="时间范围" prop="searchDateRange">
            <el-date-picker clearable size="small"
                            @change="drawXll"
                            v-model="query2Params.searchDateRange"
                            type="datetimerange"
                            value-format="yyyy-MM-dd HH:mm:ss"
                            range-separator="至"
                            start-placeholder="开始时间"
                            end-placeholder="结束时间">
            </el-date-picker>
          </el-form-item>
          <el-form-item>
            <!--<el-button type="primary" icon="el-icon-search" size="mini" @click="drawXll">搜索</el-button>-->
          </el-form-item>
        </el-form>

        <el-tabs value="tab1" @tab-click="toggleTab2">
          <el-tab-pane label="瞬时下料量" name="tab1" class="fill">
            <div ref="lcjllWaresChart" style="width: 100%;height: 600px"></div>
          </el-tab-pane>
          <el-tab-pane label="偏差" name="tab2" class="fill">
            <div ref="lcjllWarepChart" style="width: 100%;height: 600px"></div>
          </el-tab-pane>
        </el-tabs>
      </el-dialog>

      <el-dialog title="下料量记录" :visible.sync="lcjll" width="80%" append-to-body>
        <el-form :model="queryParams" ref="queryForm" :inline="true">
          <el-form-item label="时间范围" prop="searchDateRange">
            <el-date-picker clearable size="small"
                            @change="drawXll"
                            v-model="query2Params.searchDateRange"
                            type="datetimerange"
                            value-format="yyyy-MM-dd HH:mm:ss"
                            range-separator="至"
                            start-placeholder="开始时间"
                            end-placeholder="结束时间">
            </el-date-picker>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="drawXll">搜索</el-button>
          </el-form-item>
        </el-form>

        <el-tabs value="tab1" @tab-click="toggleTab">
          <el-tab-pane label="瞬时下料量" name="tab1" class="fill">
            <div ref="lcjllsChart" style="width: 100%;height: 600px"></div>
          </el-tab-pane>
          <el-tab-pane label="偏差" name="tab2" class="fill">
            <div ref="lcjllpChart" style="width: 100%;height: 600px"></div>
          </el-tab-pane>
        </el-tabs>


      </el-dialog>

      <el-dialog title="当日生产统计" :visible.sync="lljl" width="60%" append-to-body>
        <table class="dayReport-table" style="width: 100%">
          <thead>
          <tr>
            <th colspan="25" width="100%" style="font-size: 1.5em" class="align-center">当日生产统计</th>
          </tr>
          </thead>
          <tbody>
          <tr>
            <th style="color: #1c84f5">仓位</th>
            <th>1</th>
            <th>2</th>
            <th>3</th>
            <th>4</th>
            <th>5</th>
            <th>6</th>
            <th>7</th>
            <th>8</th>
            <th>9</th>
            <th>10</th>
            <th>11</th>
            <th>12</th>
            <th>13</th>
            <th>14</th>
            <th>15</th>
            <th>16</th>
            <th>17</th>
            <th>18</th>
            <th>19</th>
            <th>20</th>
            <th>21</th>
            <th>22</th>
            <th>23</th>
            <!--<th rowspan="2">累计</th>-->
          </tr>
          <tr>
            <th style="color: #1c84f5">矿料</th>
            <th style="color: red" v-for="(silo,index) in siloList">{{ silo.matterName }}</th>
          </tr>
          <tr>
            <th rowspan="2" style="color: #1c84f5">夜班统计</th>
            <td colspan="6" style="background-color:  #6e767f;color: #eeeeee">{{
                getSumAdd(nowObj.st2_night1_total.cacheValue, nowObj.st2_night2_total.cacheValue, nowObj.st2_night3_total.cacheValue, nowObj.st2_night4_total.cacheValue,
                  nowObj.st2_night5_total.cacheValue, nowObj.st2_night6_total.cacheValue)
              }}
            </td>
            <td colspan="5" style="background-color:  #6e767f;color: #eeeeee">
              {{ getSumAdd(nowObj.st2_night7_total.cacheValue, nowObj.st2_night8_total.cacheValue, nowObj.st2_night9_total.cacheValue, nowObj.st2_night10_total.cacheValue, nowObj.st2_night11_total.cacheValue) }}
            </td>
            <td colspan="4" style="background-color:  #6e767f;color: #eeeeee">
              {{ getSumAdd(nowObj.st2_night12_total.cacheValue, nowObj.st2_night13_total.cacheValue, nowObj.st2_night14_total.cacheValue, nowObj.st2_night15_total.cacheValue) }}
            </td>
            <td colspan="4" style="background-color:  #6e767f;color: #eeeeee">
              {{ getSumAdd(nowObj.st2_night16_total.cacheValue, nowObj.st2_night17_total.cacheValue, nowObj.st2_night18_total.cacheValue, nowObj.st2_night19_total.cacheValue) }}
            </td>
            <td colspan="4" style="background-color:  #6e767f;color: #eeeeee">
              {{ getSumAdd(nowObj.st2_night20_total.cacheValue, nowObj.st2_night21_total.cacheValue, nowObj.st2_night22_total.cacheValue, nowObj.st2_night23_total.cacheValue) }}
            </td>
            <!--<td rowspan="2" style="background-color:  #6e767f;color: #eeeeee">{{nowObj.st2_night16_total.cacheValue}}</td>-->
          </tr>
          <tr>
            <td>{{ nowObj.st2_night1_total.cacheValue }}</td>
            <td>{{ nowObj.st2_night2_total.cacheValue }}</td>
            <td>{{ nowObj.st2_night3_total.cacheValue }}</td>
            <td>{{ nowObj.st2_night4_total.cacheValue }}</td>
            <td>{{ nowObj.st2_night5_total.cacheValue }}</td>
            <td>{{ nowObj.st2_night6_total.cacheValue }}</td>
            <td>{{ nowObj.st2_night7_total.cacheValue }}</td>
            <td>{{ nowObj.st2_night8_total.cacheValue }}</td>
            <td>{{ nowObj.st2_night9_total.cacheValue }}</td>
            <td>{{ nowObj.st2_night10_total.cacheValue }}</td>
            <td>{{ nowObj.st2_night11_total.cacheValue }}</td>
            <td>{{ nowObj.st2_night12_total.cacheValue }}</td>
            <td>{{ nowObj.st2_night13_total.cacheValue }}</td>
            <td>{{ nowObj.st2_night14_total.cacheValue }}</td>
            <td>{{ nowObj.st2_night15_total.cacheValue }}</td>
            <td>{{ nowObj.st2_night16_total.cacheValue }}</td>
            <td>{{ nowObj.st2_night17_total.cacheValue }}</td>
            <td>{{ nowObj.st2_night18_total.cacheValue }}</td>
            <td>{{ nowObj.st2_night19_total.cacheValue }}</td>
            <td>{{ nowObj.st2_night20_total.cacheValue }}</td>
            <td>{{ nowObj.st2_night21_total.cacheValue }}</td>
            <td>{{ nowObj.st2_night22_total.cacheValue }}</td>
            <td>{{ nowObj.st2_night23_total.cacheValue }}</td>
          </tr>
          <tr>
            <th rowspan="2" style="color: #1c84f5">白班统计</th>
            <td colspan="6" style="background-color:  #6e767f;color: #eeeeee">{{
                getSumAdd(nowObj.st2_day1_total.cacheValue, nowObj.st2_day2_total.cacheValue, nowObj.st2_day3_total.cacheValue, nowObj.st2_day4_total.cacheValue,
                  nowObj.st2_day5_total.cacheValue, nowObj.st2_day6_total.cacheValue)
              }}
            </td>
            <td colspan="5" style="background-color:  #6e767f;color: #eeeeee">
              {{ getSumAdd(nowObj.st2_day7_total.cacheValue, nowObj.st2_day8_total.cacheValue, nowObj.st2_day9_total.cacheValue, nowObj.st2_day10_total.cacheValue, nowObj.st2_day11_total.cacheValue) }}
            </td>
            <td colspan="4" style="background-color:  #6e767f;color: #eeeeee">
              {{ getSumAdd(nowObj.st2_day12_total.cacheValue, nowObj.st2_day13_total.cacheValue, nowObj.st2_day14_total.cacheValue, nowObj.st2_day15_total.cacheValue) }}
            </td>
            <td colspan="4" style="background-color:  #6e767f;color: #eeeeee">
              {{ getSumAdd(nowObj.st2_day16_total.cacheValue, nowObj.st2_day17_total.cacheValue, nowObj.st2_day18_total.cacheValue, nowObj.st2_day19_total.cacheValue) }}
            </td>
            <td colspan="4" style="background-color:  #6e767f;color: #eeeeee">
              {{ getSumAdd(nowObj.st2_day20_total.cacheValue, nowObj.st2_day21_total.cacheValue, nowObj.st2_day22_total.cacheValue, nowObj.st2_day23_total.cacheValue) }}
            </td>
            <!--<td rowspan="2" style="background-color:  #6e767f;color: #eeeeee">{{nowObj.st2_day16_total.cacheValue}}</td>-->
          </tr>
          <tr>
            <td>{{ nowObj.st2_day1_total.cacheValue }}</td>
            <td>{{ nowObj.st2_day2_total.cacheValue }}</td>
            <td>{{ nowObj.st2_day3_total.cacheValue }}</td>
            <td>{{ nowObj.st2_day4_total.cacheValue }}</td>
            <td>{{ nowObj.st2_day5_total.cacheValue }}</td>
            <td>{{ nowObj.st2_day6_total.cacheValue }}</td>
            <td>{{ nowObj.st2_day7_total.cacheValue }}</td>
            <td>{{ nowObj.st2_day8_total.cacheValue }}</td>
            <td>{{ nowObj.st2_day9_total.cacheValue }}</td>
            <td>{{ nowObj.st2_day10_total.cacheValue }}</td>
            <td>{{ nowObj.st2_day11_total.cacheValue }}</td>
            <td>{{ nowObj.st2_day12_total.cacheValue }}</td>
            <td>{{ nowObj.st2_day13_total.cacheValue }}</td>
            <td>{{ nowObj.st2_day14_total.cacheValue }}</td>
            <td>{{ nowObj.st2_day15_total.cacheValue }}</td>
            <td>{{ nowObj.st2_day16_total.cacheValue }}</td>
            <td>{{ nowObj.st2_day17_total.cacheValue }}</td>
            <td>{{ nowObj.st2_day18_total.cacheValue }}</td>
            <td>{{ nowObj.st2_day19_total.cacheValue }}</td>
            <td>{{ nowObj.st2_day20_total.cacheValue }}</td>
            <td>{{ nowObj.st2_day21_total.cacheValue }}</td>
            <td>{{ nowObj.st2_day22_total.cacheValue }}</td>
            <td>{{ nowObj.st2_day23_total.cacheValue }}</td>
          </tr>
          <tr>
            <th rowspan="2" style="color: #1c84f5">中班统计</th>
            <td colspan="6" style="background-color:  #6e767f;color: #eeeeee">
              {{ getSumAdd(nowObj.st2_daily1_total.cacheValue, nowObj.st2_daily2_total.cacheValue, nowObj.st2_daily3_total.cacheValue, nowObj.st2_daily4_total.cacheValue, nowObj.st2_daily5_total.cacheValue, nowObj.st2_daily6_total.cacheValue) }}
            </td>
            <td colspan="5" style="background-color:  #6e767f;color: #eeeeee">
              {{ getSumAdd(nowObj.st2_daily7_total.cacheValue, nowObj.st2_daily8_total.cacheValue, nowObj.st2_daily9_total.cacheValue, nowObj.st2_daily10_total.cacheValue, nowObj.st2_daily11_total.cacheValue) }}
            </td>
            <td colspan="4" style="background-color:  #6e767f;color: #eeeeee">
              {{ getSumAdd(nowObj.st2_daily12_total.cacheValue, nowObj.st2_daily13_total.cacheValue, nowObj.st2_daily14_total.cacheValue, nowObj.st2_daily15_total.cacheValue) }}
            </td>
            <td colspan="4" style="background-color:  #6e767f;color: #eeeeee">
              {{ getSumAdd(nowObj.st2_daily16_total.cacheValue, nowObj.st2_daily17_total.cacheValue, nowObj.st2_daily18_total.cacheValue, nowObj.st2_daily19_total.cacheValue) }}
            </td>
            <td colspan="4" style="background-color:  #6e767f;color: #eeeeee">
              {{ getSumAdd(nowObj.st2_daily20_total.cacheValue, nowObj.st2_daily21_total.cacheValue, nowObj.st2_daily22_total.cacheValue, nowObj.st2_daily23_total.cacheValue) }}
            </td>
            <!--<td rowspan="2" style="background-color:  #6e767f;color: #eeeeee">{{nowObj.st2_daily16_total.cacheValue}}</td>-->
          </tr>
          <tr>
            <td>{{ nowObj.st2_mid1_total.cacheValue }}</td>
            <td>{{ nowObj.st2_mid2_total.cacheValue }}</td>
            <td>{{ nowObj.st2_mid3_total.cacheValue }}</td>
            <td>{{ nowObj.st2_mid4_total.cacheValue }}</td>
            <td>{{ nowObj.st2_mid5_total.cacheValue }}</td>
            <td>{{ nowObj.st2_mid6_total.cacheValue }}</td>
            <td>{{ nowObj.st2_mid7_total.cacheValue }}</td>
            <td>{{ nowObj.st2_mid8_total.cacheValue }}</td>
            <td>{{ nowObj.st2_mid9_total.cacheValue }}</td>
            <td>{{ nowObj.st2_mid10_total.cacheValue }}</td>
            <td>{{ nowObj.st2_mid11_total.cacheValue }}</td>
            <td>{{ nowObj.st2_mid12_total.cacheValue }}</td>
            <td>{{ nowObj.st2_mid13_total.cacheValue }}</td>
            <td>{{ nowObj.st2_mid14_total.cacheValue }}</td>
            <td>{{ nowObj.st2_mid15_total.cacheValue }}</td>
            <td>{{ nowObj.st2_mid16_total.cacheValue }}</td>
            <td>{{ nowObj.st2_mid17_total.cacheValue }}</td>
            <td>{{ nowObj.st2_mid18_total.cacheValue }}</td>
            <td>{{ nowObj.st2_mid19_total.cacheValue }}</td>
            <td>{{ nowObj.st2_mid20_total.cacheValue }}</td>
            <td>{{ nowObj.st2_mid21_total.cacheValue }}</td>
            <td>{{ nowObj.st2_mid22_total.cacheValue }}</td>
            <td>{{ nowObj.st2_mid23_total.cacheValue }}</td>
          </tr>
          </tbody>
        </table>
      </el-dialog>


      <el-dialog title="前日生产统计" :visible.sync="plzl" width="60%" append-to-body>
        <table class="dayReport-table" style="width: 100%">
          <thead>
          <tr>
            <th colspan="17" width="100%" style="font-size: 1.5em" class="align-center">前日生产统计</th>
          </tr>
          </thead>
          <tbody>
          <tr>
            <th>仓位</th>
            <th>1</th>
            <th>2</th>
            <th>3</th>
            <th>4</th>
            <th>5</th>
            <th>6</th>
            <th>7</th>
            <th>8</th>
            <th>9</th>
            <th>10</th>
            <th>11</th>
            <th>12</th>
            <th>13</th>
            <th>14</th>
            <th>15</th>
            <th rowspan="2">累计</th>
          </tr>
          <tr>
            <th>矿料</th>
            <th style="color: red" v-for="(silo,index) in siloList">{{ silo.matterName }}</th>
          </tr>
          <tr>
            <th rowspan="2" style="color: #1c84f5">夜班统计</th>
            <!--<td colspan="6" style="background-color:  #6e767f;color: #eeeeee">{{getSumAdd(nowObj.st2_previous1_night.cacheValue,nowObj.st2_previous2_night.cacheValue,nowObj.st2_previous3_night.cacheValue,nowObj.st2_previous4_night.cacheValue,-->
            <!--nowObj.st2_previous5_night.cacheValue,nowObj.st2_previous6_night.cacheValue)}}</td>-->
            <!--<td colspan="3" style="background-color:  #6e767f;color: #eeeeee">{{getSumAdd(nowObj.st2_previous7_night.cacheValue,nowObj.st2_previous8_night.cacheValue, nowObj.st2_previous9_night.cacheValue)}}</td>-->
            <!--<td colspan="2" style="background-color:  #6e767f;color: #eeeeee">{{getSumAdd(nowObj.st2_previous10_night.cacheValue,nowObj.st2_previous11_night.cacheValue)}}</td>-->
            <!--<td colspan="2" style="background-color:  #6e767f;color: #eeeeee">{{getSumAdd(nowObj.st2_previous12_night.cacheValue,nowObj.st2_previous13_night.cacheValue)}}</td>-->
            <!--<td colspan="2" style="background-color:  #6e767f;color: #eeeeee">{{getSumAdd(nowObj.st2_previous14_night.cacheValue,nowObj.st2_previous15_night.cacheValue)}}</td>-->
            <!--<td rowspan="2" style="background-color:  #6e767f;color: #eeeeee">{{nowObj.st2_previous15_night.cacheValue}}</td>-->
          </tr>
          <tr>
            <!--<td>{{nowObj.st2_previous1_night.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous2_night.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous3_night.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous4_night.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous5_night.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous6_night.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous7_night.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous8_night.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous9_night.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous10_night.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous11_night.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous12_night.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous13_night.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous14_night.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous15_night.cacheValue}}</td>-->
          </tr>
          <tr>
            <th rowspan="2" style="color: #1c84f5">白班统计</th>
            <!--<td colspan="6" style="background-color:  #6e767f;color: #eeeeee">{{getSumAdd(nowObj.st2_previous1_day.cacheValue,nowObj.st2_previous2_day.cacheValue,nowObj.st2_previous3_day.cacheValue,nowObj.st2_previous4_day.cacheValue,-->
            <!--nowObj.st2_previous5_day.cacheValue,nowObj.st2_previous6_day.cacheValue)}}</td>-->
            <!--<td colspan="3" style="background-color:  #6e767f;color: #eeeeee">{{getSumAdd(nowObj.st2_previous7_day.cacheValue,nowObj.st2_previous8_day.cacheValue, nowObj.st2_previous9_day.cacheValue)}}</td>-->
            <!--<td colspan="2" style="background-color:  #6e767f;color: #eeeeee">{{getSumAdd(nowObj.st2_previous10_day.cacheValue,nowObj.st2_previous11_day.cacheValue)}}</td>-->
            <!--<td colspan="2" style="background-color:  #6e767f;color: #eeeeee">{{getSumAdd(nowObj.st2_previous12_day.cacheValue,nowObj.st2_previous13_day.cacheValue)}}</td>-->
            <!--<td colspan="2" style="background-color:  #6e767f;color: #eeeeee">{{getSumAdd(nowObj.st2_previous14_day.cacheValue,nowObj.st2_previous15_day.cacheValue)}}</td>-->
            <!--<td rowspan="2" style="background-color:  #6e767f;color: #eeeeee">{{nowObj.st2_all_previous_day.cacheValue}}</td>-->
          </tr>
          <tr>
            <!--<td>{{nowObj.st2_previous1_day.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous2_day.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous3_day.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous4_day.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous5_day.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous6_day.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous7_day.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous8_day.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous9_day.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous10_day.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous11_day.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous12_day.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous13_day.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous14_day.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous15_day.cacheValue}}</td>-->
          </tr>
          <tr>
            <th rowspan="2" style="color: #1c84f5">日统计</th>
            <!--<td colspan="6" style="background-color:  #6e767f;color: #eeeeee">{{getSumAdd(nowObj.st2_previous1_daily.cacheValue,nowObj.st2_previous2_daily.cacheValue,nowObj.st2_previous3_daily.cacheValue,nowObj.st2_previous4_daily.cacheValue,-->
            <!--nowObj.st2_previous5_daily.cacheValue,nowObj.st2_previous6_daily.cacheValue)}}</td>-->
            <!--<td colspan="3" style="background-color:  #6e767f;color: #eeeeee">{{getSumAdd(nowObj.st2_previous7_daily.cacheValue,nowObj.st2_previous8_daily.cacheValue, nowObj.st2_previous9_daily.cacheValue)}}</td>-->
            <!--<td colspan="2" style="background-color:  #6e767f;color: #eeeeee">{{getSumAdd(nowObj.st2_previous10_daily.cacheValue,nowObj.st2_previous11_daily.cacheValue)}}</td>-->
            <!--<td colspan="2" style="background-color:  #6e767f;color: #eeeeee">{{getSumAdd(nowObj.st2_previous12_daily.cacheValue,nowObj.st2_previous13_daily.cacheValue)}}</td>-->
            <!--<td colspan="2" style="background-color:  #6e767f;color: #eeeeee">{{getSumAdd(nowObj.st2_previous14_daily.cacheValue,nowObj.st2_previous15_daily.cacheValue)}}</td>-->
            <!--<td rowspan="2" style="background-color:  #6e767f;color: #eeeeee">{{nowObj.st2_all_previous_daily.cacheValue}}</td>-->
          </tr>
          <tr>
            <!--<td>{{nowObj.st2_previous1_daily.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous2_daily.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous3_daily.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous4_daily.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous5_daily.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous6_daily.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous7_daily.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous8_daily.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous9_daily.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous10_daily.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous11_daily.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous12_daily.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous13_daily.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous14_daily.cacheValue}}</td>-->
            <!--<td>{{nowObj.st2_previous15_daily.cacheValue}}</td>-->
          </tr>
          </tbody>
        </table>
      </el-dialog>


    </el-card>


  </div>
</template>

<script>

import {pageSilo, getSilo, delSilo, addSilo, updateSilo} from '@/api/app/silo/silo'
import {getOptionList, getMixedAttrValue, updateInfo} from '@/api/app/silo/info'
import CanvasSilo from './../canvas/silo'
import CanvasBelt from './../canvas/belt'
import CanvasArrow from './../canvas/arrow'
import SinterMatter from "./../info/sinterMatter";
import BatchingCalculationPage from "./../info/BatchingCalculationPage";
import * as echarts from "echarts";
import {getDataByCode, getHisChart, getRealDataByTags, getSiloDataNow} from '@/api/app/plc/cache'


export default {
  name: 'Silo',
  components: {
    BatchingCalculationPage,
    SinterMatter,
    CanvasSilo,
    CanvasBelt,
    CanvasArrow,
  },
  data() {
    return {

      setSum: null,
      ratioSum: null,
      linRatioSum: null,
      insSum: null,

      timer: null,
      timer2: null,
      siloList: [],
      topList: [0, 1, 2, 3, 4, 5, 6, 7],
      downList: [8, 9, 10, 11, 12, 13, 14],
      lcCode: '',
      silo: {},
      lcxll: false,
      lz: false,
      pbsd: false,
      pbsdCut: false,
      lcjll: false,
      lcjllWare: false,
      lljl: false,
      xsjl: false,
      plzl: false,
      siloItem: null,

      ssCode: '',
      ssxll: false,

      tabName: '',
      nowObj: {
        //'st2_all_day':{cacheValue:0},
        'st2_night1_total': {cacheValue: 0},
        'st2_night2_total': {cacheValue: 0},
        'st2_night3_total': {cacheValue: 0},
        'st2_night4_total': {cacheValue: 0},
        'st2_night5_total': {cacheValue: 0},
        'st2_night6_total': {cacheValue: 0},
        'st2_night7_total': {cacheValue: 0},
        'st2_night8_total': {cacheValue: 0},
        'st2_night9_total': {cacheValue: 0},
        'st2_night10_total': {cacheValue: 0},
        'st2_night11_total': {cacheValue: 0},
        'st2_night12_total': {cacheValue: 0},
        'st2_night13_total': {cacheValue: 0},
        'st2_night14_total': {cacheValue: 0},
        'st2_night15_total': {cacheValue: 0},
        'st2_night16_total': {cacheValue: 0},
        'st2_night17_total': {cacheValue: 0},
        'st2_night18_total': {cacheValue: 0},
        'st2_night19_total': {cacheValue: 0},
        'st2_night20_total': {cacheValue: 0},
        'st2_night21_total': {cacheValue: 0},
        'st2_night22_total': {cacheValue: 0},
        'st2_night23_total': {cacheValue: 0},


        'st2_day1_total': {cacheValue: 0},
        'st2_day2_total': {cacheValue: 0},
        'st2_day3_total': {cacheValue: 0},
        'st2_day4_total': {cacheValue: 0},
        'st2_day5_total': {cacheValue: 0},
        'st2_day6_total': {cacheValue: 0},
        'st2_day7_total': {cacheValue: 0},
        'st2_day8_total': {cacheValue: 0},
        'st2_day9_total': {cacheValue: 0},
        'st2_day10_total': {cacheValue: 0},
        'st2_day11_total': {cacheValue: 0},
        'st2_day12_total': {cacheValue: 0},
        'st2_day13_total': {cacheValue: 0},
        'st2_day14_total': {cacheValue: 0},
        'st2_day15_total': {cacheValue: 0},
        'st2_day16_total': {cacheValue: 0},
        'st2_day17_total': {cacheValue: 0},
        'st2_day18_total': {cacheValue: 0},
        'st2_day19_total': {cacheValue: 0},
        'st2_day20_total': {cacheValue: 0},
        'st2_day21_total': {cacheValue: 0},
        'st2_day22_total': {cacheValue: 0},
        'st2_day23_total': {cacheValue: 0},

        'st2_mid1_total': {cacheValue: 0},
        'st2_mid2_total': {cacheValue: 0},
        'st2_mid3_total': {cacheValue: 0},
        'st2_mid4_total': {cacheValue: 0},
        'st2_mid5_total': {cacheValue: 0},
        'st2_mid6_total': {cacheValue: 0},
        'st2_mid7_total': {cacheValue: 0},
        'st2_mid8_total': {cacheValue: 0},
        'st2_mid9_total': {cacheValue: 0},
        'st2_mid10_total': {cacheValue: 0},
        'st2_mid11_total': {cacheValue: 0},
        'st2_mid12_total': {cacheValue: 0},
        'st2_mid13_total': {cacheValue: 0},
        'st2_mid14_total': {cacheValue: 0},
        'st2_mid15_total': {cacheValue: 0},
        'st2_mid16_total': {cacheValue: 0},
        'st2_mid17_total': {cacheValue: 0},
        'st2_mid18_total': {cacheValue: 0},
        'st2_mid19_total': {cacheValue: 0},
        'st2_mid20_total': {cacheValue: 0},
        'st2_mid21_total': {cacheValue: 0},
        'st2_mid22_total': {cacheValue: 0},
        'st2_mid23_total': {cacheValue: 0},

        'st2_daily1_total': {cacheValue: 0},
        'st2_daily2_total': {cacheValue: 0},
        'st2_daily3_total': {cacheValue: 0},
        'st2_daily4_total': {cacheValue: 0},
        'st2_daily5_total': {cacheValue: 0},
        'st2_daily6_total': {cacheValue: 0},
        'st2_daily7_total': {cacheValue: 0},
        'st2_daily8_total': {cacheValue: 0},
        'st2_daily9_total': {cacheValue: 0},
        'st2_daily10_total': {cacheValue: 0},
        'st2_daily11_total': {cacheValue: 0},
        'st2_daily12_total': {cacheValue: 0},
        'st2_daily13_total': {cacheValue: 0},
        'st2_daily14_total': {cacheValue: 0},
        'st2_daily15_total': {cacheValue: 0},
        'st2_daily16_total': {cacheValue: 0},
        'st2_daily17_total': {cacheValue: 0},
        'st2_daily18_total': {cacheValue: 0},
        'st2_daily19_total': {cacheValue: 0},
        'st2_daily20_total': {cacheValue: 0},
        'st2_daily21_total': {cacheValue: 0},
        'st2_daily22_total': {cacheValue: 0},
        'st2_daily23_total': {cacheValue: 0},


        'st2_previous1_night': {cacheValue: 0},
        'st2_previous2_night': {cacheValue: 0},
        'st2_previous3_night': {cacheValue: 0},
        'st2_previous4_night': {cacheValue: 0},
        'st2_previous5_night': {cacheValue: 0},
        'st2_previous6_night': {cacheValue: 0},
        'st2_previous7_night': {cacheValue: 0},
        'st2_previous8_night': {cacheValue: 0},
        'st2_previous9_night': {cacheValue: 0},
        'st2_previous10_night': {cacheValue: 0},
        'st2_previous11_night': {cacheValue: 0},
        'st2_previous12_night': {cacheValue: 0},
        'st2_previous13_night': {cacheValue: 0},
        'st2_previous14_night': {cacheValue: 0},
        'st2_previous15_night': {cacheValue: 0},
        'st2_all_previous': {cacheValue: 0},

        'st2_previous1_day': {cacheValue: 0},
        'st2_previous2_day': {cacheValue: 0},
        'st2_previous3_day': {cacheValue: 0},
        'st2_previous4_day': {cacheValue: 0},
        'st2_previous5_day': {cacheValue: 0},
        'st2_previous6_day': {cacheValue: 0},
        'st2_previous7_day': {cacheValue: 0},
        'st2_previous8_day': {cacheValue: 0},
        'st2_previous9_day': {cacheValue: 0},
        'st2_previous10_day': {cacheValue: 0},
        'st2_previous11_day': {cacheValue: 0},
        'st2_previous12_day': {cacheValue: 0},
        'st2_previous13_day': {cacheValue: 0},
        'st2_previous14_day': {cacheValue: 0},
        'st2_previous15_day': {cacheValue: 0},
        'st2_all_previous_day': {cacheValue: 0},

        'st2_previous1_daily': {cacheValue: 0},
        'st2_all_previous_daily': {cacheValue: 0},
        'st2_previous2_daily': {cacheValue: 0},
        'st2_previous3_daily': {cacheValue: 0},
        'st2_previous4_daily': {cacheValue: 0},
        'st2_previous5_daily': {cacheValue: 0},
        'st2_previous6_daily': {cacheValue: 0},
        'st2_previous7_daily': {cacheValue: 0},
        'st2_previous8_daily': {cacheValue: 0},
        'st2_previous9_daily': {cacheValue: 0},
        'st2_previous10_daily': {cacheValue: 0},
        'st2_previous11_daily': {cacheValue: 0},
        'st2_previous12_daily': {cacheValue: 0},
        'st2_previous13_daily': {cacheValue: 0},
        'st2_previous14_daily': {cacheValue: 0},
        'st2_previous15_daily': {cacheValue: 0},


      },

      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 料仓表格数据
      silo2List: [],
      // 弹出层标题
      title: '',
      // 是否显示弹出层
      open: false,
      // 查询参数
      query2Params: {
        searchDateRange: [this.moment().subtract('hours', 1).format('YYYY-MM-DD HH:mm:ss'), this.moment().format('YYYY-MM-DD HH:mm:ss')],
      },
      queryParams: {
        pageNum: 1,
        pageSize: 30,
        siloCode: null,
        matterName: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {}
    }
  },
  created() {
    this.timer2 = setInterval(() => {
      this.getList()
    }, 1000)

    // this.get2List();
    this.getSiloDataNow()
    // this.timer = setInterval(() => {
    //   this.get2List()
    // }, 3000)
  },
  destroyed() {
    clearInterval(this.timer)
    clearInterval(this.timer2)
  },

  methods: {
    getSiloDataNow() {
      getSiloDataNow().then(res => {
        this.setSum = res.data.setSum
        this.ratioSum = res.data.ratioSum
        this.linRatioSum = res.data.linRatioSum
        this.insSum = res.data.insSum

      })
    },
    get2List() {
      getOptionList({}).then(response => {
        this.siloList = response.data.rows
        //alert(this.siloList[1].matterName);
      })
    },

    soilClick(type) {
      if (type == 1) {
        this.pbsd = false
        this.lcjll = false
        this.lljl = false
        this.xsjl = false
        this.plzl = false
        if (this.lz == true) {
          this.lz = false
        } else {
          this.lz = true
        }
      } else if (type == 2) {
        this.lz = false
        this.lcjll = false
        this.lljl = false
        this.xsjl = false
        this.plzl = false
        if (this.pbsd == true) {
          this.pbsd = false
        } else {
          this.pbsd = true
          this.draLczDataChart()
        }
      } else if (type == 3) {
        this.lz = false
        this.pbsd = false
        this.lljl = false
        this.xsjl = false
        this.plzl = false
        if (this.lcjll == true) {
          this.lcjll = false
        } else {
          this.lcjll = true
          this.draLJwDataChart()
        }
      } else if (type == 4) {
        this.lz = false
        this.pbsd = false
        this.lcjll = false
        this.xsjl = false
        this.plzl = false
        if (this.lljl == true) {
          this.lljl = false
        } else {
          this.lljl = true
          this.draLSsDataChart()
        }
      } else if (type == 5) {
        this.lz = false
        this.pbsd = false
        this.lcjll = false
        this.lljl = false
        this.plzl = false
        if (this.xsjl == true) {
          this.xsjl = false
        } else {
          this.xsjl = true
        }
      } else if (type == 6) {
        this.lz = false
        this.pbsd = false
        this.lcjll = false
        this.lljl = false
        this.xsjl = false
        if (this.plzl == true) {
          this.plzl = false
        } else {
          this.drawPlzlChart()
          this.plzl = true
        }
      } else if (type == 7) {

      }
    },
    draPcDataChart(row) {
      if (this.query2Params.searchDateRange) {
        let data = {
          timeTag: 1,
          startDt: this.query2Params.searchDateRange[0],
          endDt: this.query2Params.searchDateRange[1]
        }
        //alert(row);
        data.codes = row.pianchaCode
        let colorList = ['#fc8251']
        getHisChart(data).then(response => {
          this.$nextTick(() => {
            let eList = response.data
            let series = []
            let list1 = []
            let nameList = [], xdata = []
            //名称
            nameList.push(eList[0].name)

            //数据
            for (let a = 0; a < eList[0].list.length; a++) {
              xdata.push(eList[0].list[a].dt)
              list1.push(eList[0].list[a].value)
            }
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[0],
              data: list1,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[0]}
            })


            let chart = echarts.init(this.$refs.lcjllWarepChart, 'light')
            let option = {
              grid: {
                left: 60,
                right: 60,
                bottom: 20,
                containLabel: true
              },
              "backgroundColor": "rgba(0, 0, 0, 0)",
              dataZoom: {
                type: 'inside',
                zoomOnMouseWheel: true,
              },
              xAxis: {
                type: 'category',
                data: xdata,
              },
              yAxis: [{
                name: '瞬时下料量',
                type: 'value',
                splitLine: {
                  lineStyle: {
                    type: 'dotted',
                    //color: ['#aaa', '#ddd']
                  }
                },
                axisLabel: {
                  textStyle: {
                    color: '#000'
                  },
                },
                min: function (val) {
                  return parseInt(val.min - 10)
                },
                max: function (val) {
                  return parseInt(val.max + 10)
                },
              }],
              tooltip: {
                trigger: 'axis', //设置tip提示
                axisPointer: { // 坐标轴指示器，坐标轴触发有效
                  type: 'line' // 默认为直线，可选为：'line' | 'shadow'
                }
              },
              legend: [{
                x: 'center',
                data: ['料仓偏差'],
              }],
              series: series
            }
            chart.setOption(option, true)
          })
        })
      }
    },
    draLJwDataChartWare(row) {
      if (this.query2Params.searchDateRange) {
        let data = {
          timeTag: 1,
          startDt: this.query2Params.searchDateRange[0],
          endDt: this.query2Params.searchDateRange[1]
        }
        data.codes = row.cuttingCode
        let colorList = ['#fc8251']
        getHisChart(data).then(response => {
          this.$nextTick(() => {
            let eList = response.data
            let series = []
            let list1 = []
            let nameList = [], xdata = []
            //名称
            nameList.push(eList[0].name)

            //数据
            for (let a = 0; a < eList[0].list.length; a++) {
              xdata.push(eList[0].list[a].dt)
              list1.push(eList[0].list[a].value)
            }
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[0],
              data: list1,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[0]}
            })


            let chart = echarts.init(this.$refs.lcjllWaresChart, 'light')
            let option = {
              grid: {
                left: 60,
                right: 60,
                bottom: 20,
                containLabel: true
              },
              "backgroundColor": "rgba(0, 0, 0, 0)",
              dataZoom: {
                type: 'inside',
                zoomOnMouseWheel: true,
              },
              xAxis: {
                type: 'category',
                data: xdata,
              },
              yAxis: [{
                name: '瞬时下料量',
                type: 'value',
                splitLine: {
                  lineStyle: {
                    type: 'dotted',
                    //color: ['#aaa', '#ddd']
                  }
                },
                axisLabel: {
                  textStyle: {
                    color: '#000'
                  },
                },
                min: function (val) {
                  return parseInt(val.min - 10)
                },
                max: function (val) {
                  return parseInt(val.max + 10)
                },
              }],
              tooltip: {
                trigger: 'axis', //设置tip提示
                axisPointer: { // 坐标轴指示器，坐标轴触发有效
                  type: 'line' // 默认为直线，可选为：'line' | 'shadow'
                }
              },
              legend: [{
                x: 'center',
                data: ['料仓配料秤料流量'],
              }],
              series: series
            }
            chart.setOption(option, true)
          })
        })
      }
    },
    draLczDataChartCut(row) {
      if (this.query2Params.searchDateRange) {
        let data = {
          timeTag: 1,
          startDt: this.query2Params.searchDateRange[0],
          endDt: this.query2Params.searchDateRange[1]
        }
        data.codes = row.weightCode
        //alert(555)
        let colorList = ['#fc8251']
        getHisChart(data).then(response => {
          this.$nextTick(() => {
            let eList = response.data
            let series = []
            let list1 = []
            let nameList = [], xdata = []
            //名称
            nameList.push(eList[0].name)
            //数据
            for (let a = 0; a < eList[0].list.length; a++) {
              xdata.push(eList[0].list[a].dt)
              list1.push(eList[0].list[a].value)
            }
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[0],
              data: list1,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[0]}
            })

            let chart = echarts.init(this.$refs.czjlChartCut, 'light')
            let option = {
              grid: {
                left: 60,
                right: 60,
                bottom: 20,
                containLabel: true
              },
              "backgroundColor": "rgba(0, 0, 0, 0)",
              dataZoom: {
                type: 'inside',
                zoomOnMouseWheel: true,
              },
              xAxis: {
                type: 'category',
                data: xdata,
              },
              yAxis: [{
                name: '料仓重量',
                type: 'value',
                splitLine: {
                  lineStyle: {
                    type: 'dotted',
                    //color: ['#aaa', '#ddd']
                  }
                },
                axisLabel: {
                  textStyle: {
                    color: '#000'
                  },
                },
                min: function (val) {
                  return parseInt(val.min - 20)
                },
                max: function (val) {
                  return parseInt(val.max + 20)
                },
              }],
              tooltip: {
                trigger: 'axis', //设置tip提示
                axisPointer: { // 坐标轴指示器，坐标轴触发有效
                  type: 'line' // 默认为直线，可选为：'line' | 'shadow'
                }
              },
              legend: [{
                x: 'center',
                data: ['料仓料重'],
              }],
              series: series
            }
            chart.setOption(option, true)


          })
        })
      }
    },
    //料仓重量
    draLczDataChart() {
      if (this.query2Params.searchDateRange) {
        let data = {
          timeTag: 1,
          startDt: this.query2Params.searchDateRange[0],
          endDt: this.query2Params.searchDateRange[1]
        }
        data.codes =
          "st2_bin_weight1" + "," + "st2_bin_weight2" + "," + "st2_bin_weight3" + "," + "st2_bin_weight4" + "," + "st2_bin_weight5" + "," + "st2_bin_weight6" + "," +
          "st2_bin_weight7" + "," + "st2_bin_weight8" + "," + "st2_bin_weight9" + "," + "st2_bin_weight10" + "," + "st2_bin_weight11" + "," + "st2_bin_weight12" + "," + "st2_bin_weight13" + "," + "st2_bin_weight14" + "," + "st2_bin_weight15" + ","
          + "st2_bin_weight16" + "," + "st2_bin_weight17" + "," + "st2_bin_weight18" + "," + "st2_bin_weight19" + "," + "st2_bin_weight20" + "," + "st2_bin_weight21" + "," + "st2_bin_weight22"
        let colorList = ['#fc8251', '#5470c6', '#9A60B4', '#ef5699', '#f9c956', '#AA069F', '#FD0100', '#FC7D02', '#93CE07', '#E76264', '#B473D2', '#724488', '#9A60B4', '#B94F51', '#9A60B4', '#B94F51', '#FC8251', '#48B47C', '#B4B24B', '#452DB4', '#417FB4', '#B46C10']
        getHisChart(data).then(response => {
          this.$nextTick(() => {
            let eList = response.data
            console.log("7777:" + eList[0])
            console.log("7778:" + eList[1])

            let series = []
            let list1 = [], list2 = [], list3 = [], list4 = [], list5 = [], list6 = [], list7 = [], list8 = [],
              list9 = [], list10 = [], list11 = [], list12 = [], list13 = [], list14 = [], list15 = [],
              list16 = [], list17 = [], list18 = [], list19 = [], list20 = [], list21 = [], list22 = []
            let nameList = [], xdata = []
            //名称
            nameList.push(eList[0].name)
            nameList.push(eList[1].name)
            nameList.push(eList[2].name)
            nameList.push(eList[3].name)
            nameList.push(eList[4].name)
            nameList.push(eList[5].name)
            nameList.push(eList[6].name)
            nameList.push(eList[7].name)
            nameList.push(eList[8].name)
            nameList.push(eList[9].name)
            nameList.push(eList[10].name)
            nameList.push(eList[11].name)
            nameList.push(eList[12].name)
            nameList.push(eList[13].name)
            nameList.push(eList[14].name)
            nameList.push(eList[15].name)
            nameList.push(eList[16].name)
            nameList.push(eList[17].name)
            nameList.push(eList[18].name)
            nameList.push(eList[19].name)
            nameList.push(eList[20].name)
            nameList.push(eList[21].name)
            //数据
            for (let a = 0; a < eList[0].list.length; a++) {
              xdata.push(eList[0].list[a].dt)
              list1.push(eList[0].list[a].value)
              list2.push(eList[1].list[a].value)
              list3.push(eList[2].list[a].value)
              list4.push(eList[3].list[a].value)
              list5.push(eList[4].list[a].value)
              list6.push(eList[5].list[a].value)
              list7.push(eList[6].list[a].value)
              list8.push(eList[7].list[a].value)
              list9.push(eList[8].list[a].value)
              list10.push(eList[9].list[a].value)
              list11.push(eList[10].list[a].value)
              list12.push(eList[11].list[a].value)
              list13.push(eList[12].list[a].value)
              list14.push(eList[13].list[a].value)
              list15.push(eList[14].list[a].value)
              list16.push(eList[15].list[a].value)
              list17.push(eList[16].list[a].value)
              list18.push(eList[17].list[a].value)
              list19.push(eList[18].list[a].value)
              list20.push(eList[19].list[a].value)
              list21.push(eList[20].list[a].value)
              list22.push(eList[21].list[a].value)
            }
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[0],
              data: list1,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[0]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[1],
              data: list2,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[1]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[2],
              data: list3,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[2]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[3],
              data: list4,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[3]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[4],
              data: list5,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[4]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[5],
              data: list6,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[5]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[6],
              data: list7,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[6]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[7],
              data: list8,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[7]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[8],
              data: list9,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[8]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[9],
              data: list10,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[9]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[10],
              data: list11,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[10]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[11],
              data: list12,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[11]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[12],
              data: list13,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[12]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[13],
              data: list14,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[13]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[14],
              data: list15,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[14]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[15],
              data: list16,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[15]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[16],
              data: list17,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[16]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[17],
              data: list18,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[17]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[18],
              data: list19,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[18]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[19],
              data: list20,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[19]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[20],
              data: list21,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[20]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[21],
              data: list22,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[21]}
            })


            let chart = echarts.init(this.$refs.czjlChart, 'light')
            let option = {
              grid: {
                left: 60,
                right: 60,
                bottom: 20,
                containLabel: true
              },
              "backgroundColor": "rgba(0, 0, 0, 0)",
              dataZoom: {
                type: 'inside',
                zoomOnMouseWheel: true,
              },
              xAxis: {
                type: 'category',
                data: xdata,
              },
              yAxis: [{
                name: '料仓重量',
                type: 'value',
                splitLine: {
                  lineStyle: {
                    type: 'dotted',
                    //color: ['#aaa', '#ddd']
                  }
                },
                axisLabel: {
                  textStyle: {
                    color: '#000'
                  },
                },
                min: function (val) {
                  return parseInt(val.min - 20)
                },
                max: function (val) {
                  return parseInt(val.max + 20)
                },
              }],
              tooltip: {
                trigger: 'axis', //设置tip提示
                axisPointer: { // 坐标轴指示器，坐标轴触发有效
                  type: 'line' // 默认为直线，可选为：'line' | 'shadow'
                }
              },
              legend: [{
                x: 'center',
                data: ['1#料仓料重', '2#料仓料重', '3#料仓料重', '4#料仓料重', '5#料仓料重', '6#料仓料重', '7#料仓料重'],
              },
                {
                  x: 'center',
                  top: '3%',
                  data: ['8#料仓料重', '9#料仓料重', '10#料仓料重', '11#料仓料重', '12#料仓料重', '13#料仓料重', '14#料仓料重', '15#料仓料重'],
                },
                {
                  x: 'center',
                  top: '6%',
                  data: ['16#料仓料重', '17#料仓料重', '18#料仓料重', '19#料仓料重', '20#料仓料重', '21#料仓料重', '22#料仓料重'],
                }],


              series: series
            }
            chart.setOption(option, true)
          })
        })
      }
    },
    //下料量记录
    draLJwDataChart() {
      if (this.query2Params.searchDateRange) {
        let data = {
          timeTag: 1,
          startDt: this.query2Params.searchDateRange[0],
          endDt: this.query2Params.searchDateRange[1]
        }
        data.codes =
          "st2_bin_flow1" + "," + "st2_bin_flow2" + "," + "st2_bin_flow3" + "," + "st2_bin_flow4" + "," + "st2_bin_flow5" + "," + "st2_bin_flow6" + "," + "st2_bin_flow7" + "," + "st2_bin_flow8" + "," +
          "st2_bin_flow9" + "," + "st2_bin_flow10" + "," + "st2_bin_flow11" + "," + "st2_bin_flow12" + "," + "st2_bin_flow13" + "," + "st2_bin_flow14" + "," + "st2_bin_flow15" + ","
          + "st2_bin_flow16" + "," + "st2_bin_flow17" + "," + "st2_bin_flow18" + "," + "st2_bin_flow19" + "," + "st2_bin_flow20" + "," + "st2_bin_flow21" + "," + "st2_bin_flow22" + "," + "st2_bin_flow23"
        let colorList = ['#fc8251', '#5470c6', '#9A60B4', '#ef6567', '#f9c956', '#AA069F', '#FD0100', '#FC7D02', '#93CE07', '#E76264', '#B473D2', '#724488', '#9A60B4', '#B94F51', '#FC8251', '#48B47C', '#B4B24B', '#452DB4', '#417FB4', '#B46C10', '#78B419', '#B422A0', '#2B72B4']
        getHisChart(data).then(response => {
          this.$nextTick(() => {
            let eList = response.data
            let series = []
            let list1 = [], list2 = [], list3 = [], list4 = [], list5 = [], list6 = [], list7 = [], list8 = [],
              list9 = [], list10 = [], list11 = [], list12 = [], list13 = [], list14 = [], list15 = [],
              list16 = [], list17 = [], list18 = [], list19 = [], list20 = [], list21 = [], list22 = [], list23 = [],
              list24 = [],
              list25 = [], list26 = [], list27 = [], list28 = [], list29 = [], list30 = []
            let nameList = [], xdata = []
            //名称
            nameList.push(eList[0].name)
            nameList.push(eList[1].name)
            nameList.push(eList[2].name)
            nameList.push(eList[3].name)
            nameList.push(eList[4].name)
            nameList.push(eList[5].name)
            nameList.push(eList[6].name)
            nameList.push(eList[7].name)
            nameList.push(eList[8].name)
            nameList.push(eList[9].name)
            nameList.push(eList[10].name)
            nameList.push(eList[11].name)
            nameList.push(eList[12].name)
            nameList.push(eList[13].name)
            nameList.push(eList[14].name)
            nameList.push(eList[15].name)
            nameList.push(eList[16].name)
            nameList.push(eList[17].name)
            nameList.push(eList[18].name)
            nameList.push(eList[19].name)
            nameList.push(eList[20].name)
            nameList.push(eList[21].name)
            nameList.push(eList[22].name)
            //nameList.push(eList[23].name)

            //数据
            for (let a = 0; a < eList[0].list.length; a++) {
              xdata.push(eList[0].list[a].dt)
              list1.push(eList[0].list[a].value)
              list2.push(eList[1].list[a].value)
              list3.push(eList[2].list[a].value)
              list4.push(eList[3].list[a].value)
              list5.push(eList[4].list[a].value)
              list6.push(eList[5].list[a].value)
              list7.push(eList[6].list[a].value)
              list8.push(eList[7].list[a].value)
              list9.push(eList[8].list[a].value)
              list10.push(eList[9].list[a].value)
              list11.push(eList[10].list[a].value)
              list12.push(eList[11].list[a].value)
              list13.push(eList[12].list[a].value)
              list14.push(eList[13].list[a].value)
              list15.push(eList[14].list[a].value)
              list16.push(eList[15].list[a].value)
              list17.push(eList[16].list[a].value)
              list18.push(eList[17].list[a].value)
              list19.push(eList[18].list[a].value)
              list20.push(eList[19].list[a].value)
              list21.push(eList[20].list[a].value)
              list22.push(eList[21].list[a].value)
              list23.push(eList[22].list[a].value)
              //list24.push(eList[23].list[a].value)
              // list25.push(eList[24].list[a].value)
              // list26.push(eList[25].list[a].value)
              // list27.push(eList[26].list[a].value)
              // list28.push(eList[27].list[a].value)
              // list29.push(eList[28].list[a].value)
              // list30.push(eList[29].list[a].value)

            }
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[0],
              data: list1,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[0]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[1],
              data: list2,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[1]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[2],
              data: list3,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[2]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[3],
              data: list4,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[3]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[4],
              data: list5,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[4]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[5],
              data: list6,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[5]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[6],
              data: list7,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[6]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[7],
              data: list8,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[7]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[8],
              data: list9,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[8]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[9],
              data: list10,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[9]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[10],
              data: list11,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[10]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[11],
              data: list12,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[11]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[12],
              data: list13,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[12]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[13],
              data: list14,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[13]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[14],
              data: list15,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[14]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[15],
              data: list16,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[15]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[16],
              data: list17,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[16]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[17],
              data: list18,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[17]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[18],
              data: list19,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[18]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[19],
              data: list20,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[19]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[20],
              data: list21,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[20]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[21],
              data: list22,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[21]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[22],
              data: list23,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[22]}
            })
            // series.push({
            //   showSymbol: false,
            //   yAxisIndex: 0,
            //   name: nameList[23],
            //   data: list24,
            //   type: 'line',
            //   smooth: true,
            //   itemStyle: {color: colorList[23]}
            // })


            let chart = echarts.init(this.$refs.lcjllsChart, 'light')
            let option = {
              grid: {
                left: 60,
                right: 60,
                bottom: 20,
                containLabel: true
              },
              "backgroundColor": "rgba(0, 0, 0, 0)",
              dataZoom: {
                type: 'inside',
                zoomOnMouseWheel: true,
              },
              xAxis: {
                type: 'category',
                data: xdata,
              },
              yAxis: [{
                name: '瞬时下料量',
                type: 'value',
                splitLine: {
                  lineStyle: {
                    type: 'dotted',
                    //color: ['#aaa', '#ddd']
                  }
                },
                axisLabel: {
                  textStyle: {
                    color: '#000'
                  },
                },
                min: function (val) {
                  return parseInt(val.min - 10)
                },
                max: function (val) {
                  return parseInt(val.max + 10)
                },
              }],
              tooltip: {
                trigger: 'axis', //设置tip提示
                axisPointer: { // 坐标轴指示器，坐标轴触发有效
                  type: 'line' // 默认为直线，可选为：'line' | 'shadow'
                }
              },
              legend: [{
                x: 'center',
                data: ['1#料仓配料秤料流量', '2#料仓配料秤料流量', '3#料仓配料秤料流量', '4#料仓配料秤料流量', '5#料仓配料秤料流量', '6#料仓配料秤料流量', '7#料仓配料秤料流量'],
              },
                {
                  x: 'center',
                  top: '3%',
                  data: ['8#料仓配料秤料流量', '9#料仓配料秤料流量', '10#料仓配料秤料流量', '11#料仓配料秤料流量', '12#料仓配料秤料流量', '13#料仓配料秤料流量', '14#料仓配料秤料流量', '15#料仓配料秤料流量'],
                }
                ,
                {
                  x: 'center',
                  top: '6%',
                  data: ['16#料仓配料秤料流量', '17#料仓配料秤料流量', '18#料仓配料秤料流量', '19#料仓配料秤料流量', '20#料仓配料秤料流量', '21#料仓配料秤料流量', '22#料仓配料秤料流量', '23#料仓配料秤料流量'],
                }],
              series: series
            }
            chart.setOption(option, true)
          })
        })
      }
    },
    //偏差
    draPcChart() {
      if (this.query2Params.searchDateRange) {
        let data = {
          timeTag: 1,
          startDt: this.query2Params.searchDateRange[0],
          endDt: this.query2Params.searchDateRange[1]
        }
        data.codes =
          "st2_dev1_bin" + "," + "st2_dev2_bin" + "," + "st2_dev3_bin" + "," + "st2_dev4_bin" + "," + "st2_dev5_bin" + "," + "st2_dev6_bin" + "," + "st2_dev7_bin" + "," + "st2_dev8_bin" + "," +
          "st2_dev9_bin" + "," + "st2_dev10_bin" + "," + "st2_dev11_bin" + "," + "st2_dev12_bin" + "," + "st2_dev13_bin" + "," + "st2_dev14_bin" + "," + "st2_dev15_bin" + "," + "st2_dev16_bin"
          + "," + "st2_dev17_bin" + "," + "st2_dev18_bin" + "," + "st2_dev19_bin" + "," + "st2_dev20_bin" + "," + "st2_dev21_bin" + "," + "st2_dev22_bin" + "," + "st2_dev23_bin"
        let colorList = ['#fc8251', '#5470c6', '#9A60B4', '#ef6567', '#f9c956', '#AA069F', '#FD0100', '#FC7D02', '#93CE07', '#E76264', '#B473D2', '#724488', '#9A60B4', '#B94F51', '#FC8251', '#48B47C', '#B4B24B', '#452DB4', '#417FB4', '#B46C10', '#78B419', '#B422A0', '#2B72B4']
        getHisChart(data).then(response => {
          this.$nextTick(() => {
            let eList = response.data
            let series = []
            let list1 = [], list2 = [], list3 = [], list4 = [], list5 = [], list6 = [], list7 = [], list8 = [],
              list9 = [], list10 = [], list11 = [], list12 = [], list13 = [], list14 = [], list15 = [],
              list16 = [], list17 = [], list18 = [], list19 = [], list20 = [], list21 = [], list22 = [], list23 = [],
              list24 = [],
              list25 = [], list26 = [], list27 = [], list28 = [], list29 = [], list30 = []
            let nameList = [], xdata = []
            //名称
            nameList.push(eList[0].name)
            nameList.push(eList[1].name)
            nameList.push(eList[2].name)
            nameList.push(eList[3].name)
            nameList.push(eList[4].name)
            nameList.push(eList[5].name)
            nameList.push(eList[6].name)
            nameList.push(eList[7].name)
            nameList.push(eList[8].name)
            nameList.push(eList[9].name)
            nameList.push(eList[10].name)
            nameList.push(eList[11].name)
            nameList.push(eList[12].name)
            nameList.push(eList[13].name)
            nameList.push(eList[14].name)
            nameList.push(eList[15].name)
            nameList.push(eList[16].name)
            nameList.push(eList[17].name)
            nameList.push(eList[18].name)
            nameList.push(eList[19].name)
            nameList.push(eList[20].name)
            nameList.push(eList[21].name)
            nameList.push(eList[22].name)
            //nameList.push(eList[23].name)
            //数据
            for (let a = 0; a < eList[0].list.length; a++) {
              xdata.push(eList[0].list[a].dt)
              list1.push(eList[0].list[a].value)
              list2.push(eList[1].list[a].value)
              list3.push(eList[2].list[a].value)
              list4.push(eList[3].list[a].value)
              list5.push(eList[4].list[a].value)
              list6.push(eList[5].list[a].value)
              list7.push(eList[6].list[a].value)
              list8.push(eList[7].list[a].value)
              list9.push(eList[8].list[a].value)
              list10.push(eList[9].list[a].value)
              list11.push(eList[10].list[a].value)
              list12.push(eList[11].list[a].value)
              list13.push(eList[12].list[a].value)
              list14.push(eList[13].list[a].value)
              list15.push(eList[14].list[a].value)
              list16.push(eList[15].list[a].value)
              list17.push(eList[16].list[a].value)
              list18.push(eList[17].list[a].value)
              list19.push(eList[18].list[a].value)
              list20.push(eList[19].list[a].value)
              list21.push(eList[20].list[a].value)
              list22.push(eList[21].list[a].value)
              list23.push(eList[22].list[a].value)
              //list24.push(eList[23].list[a].value)

            }
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[0],
              data: list1,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[0]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[1],
              data: list2,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[1]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[2],
              data: list3,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[2]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[3],
              data: list4,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[3]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[4],
              data: list5,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[4]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[5],
              data: list6,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[5]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[6],
              data: list7,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[6]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[7],
              data: list8,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[7]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[8],
              data: list9,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[8]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[9],
              data: list10,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[9]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[10],
              data: list11,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[10]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[11],
              data: list12,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[11]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[12],
              data: list13,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[12]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[13],
              data: list14,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[13]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[14],
              data: list15,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[14]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[15],
              data: list16,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[15]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[16],
              data: list17,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[16]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[17],
              data: list18,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[17]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[18],
              data: list19,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[18]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[19],
              data: list20,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[19]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[20],
              data: list21,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[20]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[21],
              data: list22,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[21]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[22],
              data: list23,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[22]}
            })
            // series.push({
            //   showSymbol: false,
            //   yAxisIndex: 0,
            //   name: nameList[23],
            //   data: list24,
            //   type: 'line',
            //   smooth: true,
            //   itemStyle: {color: colorList[23]}
            // })

            // TODO lcjllpChart  lcjllWarepChart

            let chart = echarts.init(this.$refs.lcjllpChart, 'light')
            let option = {
              grid: {
                left: 60,
                right: 60,
                bottom: 20,
                containLabel: true
              },
              "backgroundColor": "rgba(0, 0, 0, 0)",
              dataZoom: {
                type: 'inside',
                zoomOnMouseWheel: true,
              },
              xAxis: {
                type: 'category',
                data: xdata,
              },
              yAxis: [{
                name: '偏差值',
                type: 'value',
                splitLine: {
                  lineStyle: {
                    type: 'dotted',
                    //color: ['#aaa', '#ddd']
                  }
                },
                axisLabel: {
                  textStyle: {
                    color: '#000'
                  },
                },
                min: function (val) {
                  return parseInt(val.min - 5)
                },
                max: function (val) {
                  return parseInt(val.max + 5)
                },
              }],
              tooltip: {
                trigger: 'axis', //设置tip提示
                axisPointer: { // 坐标轴指示器，坐标轴触发有效
                  type: 'line' // 默认为直线，可选为：'line' | 'shadow'
                }
              },
              legend: [{
                x: 'center',
                data: ['1#配料仓下料偏差', '2#配料仓下料偏差', '3#配料仓下料偏差', '4#配料仓下料偏差', '5#配料仓下料偏差', '6#配料仓下料偏差', '7#配料仓下料偏差'],
              },
                {
                  x: 'center',
                  top: '3%',
                  data: ['8#配料仓下料偏差', '9#配料仓下料偏差', '10#配料仓下料偏差', '11#配料仓下料偏差', '12#配料仓下料偏差', '13#配料仓下料偏差', '14#配料仓下料偏差', '15#配料仓下料偏差'],
                },
                {
                  x: 'center',
                  top: '6%',
                  data: ['16#配料仓下料偏差', '17#配料仓下料偏差', '18#配料仓下料偏差', '19#配料仓下料偏差', '20#配料仓下料偏差', '21#配料仓下料偏差', '22#配料仓下料偏差', '23#配料仓下料偏差'],
                }],
              series: series
            }
            chart.setOption(option, true)
          })
        })
      }
    },

    drawXll() {
      if (this.tabName == 'tab2') {
        this.draPcChart()
      } else {
        this.draLJwDataChart()
      }
    },


    toggleTab(tab, event) {
      if (tab.name == 'tab2') {
        this.draPcChart()
        this.tabName = 'tab2'
      } else {
        this.draLJwDataChart()
        this.tabName = 'tab1'
      }
    },
    toggleTab2(tab, event) {
      if (tab.name == 'tab2') {
        this.draPcDataChart(this.siloItem)
        this.tabName = 'tab2'
      } else {
        this.draLJwDataChartWare(this.siloItem)
        this.tabName = 'tab1'
      }
    },


    //当日生产统计
    draLSsDataChart() {
      let _that = this
      let tempData = [
        'st2_night1_total', 'st2_night2_total', 'st2_night3_total',
        'st2_night4_total', 'st2_night5_total', 'st2_night6_total', 'st2_night7_total',
        'st2_night8_total', 'st2_night9_total', 'st2_night10_total', 'st2_night11_total',
        'st2_night12_total', 'st2_night13_total', 'st2_night14_total', 'st2_night15_total',
        'st2_night16_total', 'st2_night17_total', 'st2_night18_total', 'st2_night19_total',
        'st2_night20_total', 'st2_night21_total', 'st2_night22_total', 'st2_night23_total',

        'st2_day1_total', 'st2_day2_total', 'st2_day3_total',
        'st2_day4_total', 'st2_day5_total', 'st2_day6_total', 'st2_day7_total',
        'st2_day8_total', 'st2_day9_total', 'st2_day10_total', 'st2_day11_total',
        'st2_day12_total', 'st2_day13_total', 'st2_day14_total', 'st2_day15_total',
        'st2_day16_total', 'st2_day17_total', 'st2_day18_total', 'st2_day19_total',
        'st2_day20_total', 'st2_day21_total', 'st2_day22_total', 'st2_day23_total',

        'st2_mid1_total', 'st2_mid2_total', 'st2_mid3_total',
        'st2_mid4_total', 'st2_mid5_total', 'st2_mid6_total', 'st2_mid7_total',
        'st2_mid8_total', 'st2_mid9_total', 'st2_mid10_total', 'st2_mid11_total',
        'st2_mid12_total', 'st2_mid13_total', 'st2_mid14_total', 'st2_mid15_total',
        'st2_mid16_total', 'st2_mid17_total', 'st2_mid18_total', 'st2_mid19_total',
        'st2_mid20_total', 'st2_mid21_total', 'st2_mid22_total', 'st2_mid23_total',


        'st2_daily1_total', 'st2_daily2_total', 'st2_daily3_total',
        'st2_daily4_total', 'st2_daily5_total', 'st2_daily6_total', 'st2_daily7_total',
        'st2_daily8_total', 'st2_daily9_total', 'st2_daily10_total', 'st2_daily11_total',
        'st2_daily12_total', 'st2_daily13_total', 'st2_daily14_total', 'st2_daily15_total',
        'st2_daily16_total', 'st2_daily17_total', 'st2_daily18_total', 'st2_daily19_total',
        'st2_daily20_total', 'st2_daily21_total', 'st2_daily22_total', 'st2_daily23_total'

      ]
      var arr2 = JSON.stringify(tempData)
      getDataByCode({json: arr2}).then(res => {
        Object.keys(res.data).forEach(key => {
          _that.nowObj[key].cacheValue = res.data[key].cacheValue
        })
      })
    },
    //前日生产统计
    drawPlzlChart() {
      let _that = this
      let tempData = [

        'st2_previous1_daily', 'st2_previous2_daily', 'st2_previous3_daily', 'st2_previous4_daily',
        'st2_previous5_daily', 'st2_previous6_daily', 'st2_previous7_daily', 'st2_previous8_daily',
        'st2_previous9_daily', 'st2_previous10_daily', 'st2_previous11_daily', 'st2_previous12_daily',
        'st2_previous13_daily', 'st2_previous14_daily', 'st2_previous15_daily',
        'st2_previous16_daily', 'st2_previous17_daily', 'st2_previous18_daily',
        'st2_previous19_daily', 'st2_previous20_daily', 'st2_previous21_daily', 'st2_previous22_daily', 'st2_previous23_daily'


      ]
      var arr2 = JSON.stringify(tempData)
      getDataByCode({json: arr2}).then(res => {
        Object.keys(res.data).forEach(key => {
          _that.nowObj[key].cacheValue = res.data[key].cacheValue
        })
      })
    },

    getSumAdd(a, b, c, d, e, f, g, h, i, k, l, m, n, o, p) {
      let res = 0
      if (a) res += parseFloat(a)
      if (b) res += parseFloat(b)
      if (c) res += parseFloat(c)
      if (d) res += parseFloat(d)
      if (e) res += parseFloat(e)
      if (f) res += parseFloat(f)
      if (g) res += parseFloat(g)
      if (h) res += parseFloat(h)
      if (i) res += parseFloat(i)
      if (k) res += parseFloat(k)
      if (l) res += parseFloat(l)
      if (m) res += parseFloat(m)
      if (n) res += parseFloat(n)
      if (o) res += parseFloat(o)
      if (p) res += parseFloat(p)
      return res
    },


    drawChuteChart(silo) {
      this.lcxll = true
      this.silo = silo
      this.ssCode = silo.siloCode + "仓量"
      if (this.query2Params.searchDateRange) {
        let data = {
          timeTag: 1,
          startDt: this.query2Params.searchDateRange[0],
          endDt: this.query2Params.searchDateRange[1]
        }
        data.codes = silo.weightCode
        let colorList = ['#fc8251', '#5470c6', '#9A60B4', '#ef6567', '#f9c956', '#AA069F', '#FD0100', '#FC7D02', '#93CE07', '#E76264', '#B473D2', '#724488', '#9A60B4', '#B94F51', '#FC8251']
        getHisChart(data).then(response => {
          this.$nextTick(() => {
            let eList = response.data
            let series = []
            let list1 = [], list2 = [], list3 = [], list4 = [], nameList = [], xdata = []
            //第一条数据
            nameList.push(eList[0].name)
            for (let a = 0; a < eList[0].list.length; a++) {
              list1.push(eList[0].list[a].value)
              xdata.push(eList[0].list[a].dt)
            }
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[0],
              data: list1,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[0]}
            })

            let chart = echarts.init(this.$refs.lcxllChart, 'light')
            let option = {
              /** 保存echart图片 **/
              toolbox: {
                show: true,
                feature: {
                  saveAsImage: {
                    show: true,
                    excludeComponents: ['toolbox'],
                    pixelRatio: 2
                  }
                }
              },
              grid: {
                left: 60,
                right: 60,
                bottom: 20,
                containLabel: true
              },
              "backgroundColor": "rgba(0, 0, 0, 0)",
              dataZoom: {
                type: 'inside',
                zoomOnMouseWheel: true,
              },
              xAxis: {
                type: 'category',
                data: xdata,
              },
              yAxis: [{
                name: '仓重',
                type: 'value',
                splitLine: {
                  lineStyle: {
                    type: 'dotted',
                    //color: ['#aaa', '#ddd']
                  }
                },
                axisLabel: {
                  textStyle: {
                    color: '#000'
                  },
                },
                min: function (val) {
                  return parseInt(val.min - 20)
                },
                max: function (val) {
                  return parseInt(val.max + 20)
                },
              },],
              tooltip: {
                trigger: 'axis', //设置tip提示
                axisPointer: { // 坐标轴指示器，坐标轴触发有效
                  type: 'line' // 默认为直线，可选为：'line' | 'shadow'
                }
              },
              legend: {
                left: 'center',
              },
              series: series
            }
            chart.setOption(option, true)
          })
        })
      }
    },

    drawCuttChart(silo) {
      this.ssxll = true
      this.silo = silo
      this.lcCode = silo.siloCode + "下料量"
      if (this.query2Params.searchDateRange) {
        let data = {
          timeTag: 1,
          startDt: this.query2Params.searchDateRange[0],
          endDt: this.query2Params.searchDateRange[1]
        }
        data.codes = silo.cuttingCode + "," + silo.pianchaCode
        let colorList = ['#fc8251', '#5470c6', '#9A60B4', '#ef6567', '#f9c956', '#AA069F', '#FD0100', '#FC7D02', '#93CE07', '#E76264', '#B473D2', '#724488', '#9A60B4', '#B94F51', '#FC8251']
        getHisChart(data).then(response => {
          this.$nextTick(() => {
            let eList = response.data
            let series = []
            let list1 = [], list2 = [], list3 = [], list4 = [], nameList = [], xdata = []
            //第一条数据
            nameList.push(eList[0].name)
            nameList.push(eList[1].name)
            for (let a = 0; a < eList[0].list.length; a++) {
              xdata.push(eList[0].list[a].dt)
              list1.push(parseFloat(eList[0].list[a].value).toFixed(2))
              list2.push(parseFloat(eList[1].list[a].value).toFixed(2))
            }
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[0],
              data: list1,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[0]}
            })
            series.push({
              showSymbol: false,
              yAxisIndex: 0,
              name: nameList[1],
              data: list2,
              type: 'line',
              smooth: true,
              itemStyle: {color: colorList[2]}
            })

            let chart = echarts.init(this.$refs.ssxllChart, 'light')
            let option = {
              /** 保存echart图片 **/
              toolbox: {
                show: true,
                feature: {
                  saveAsImage: {
                    show: true,
                    excludeComponents: ['toolbox'],
                    pixelRatio: 2
                  }
                }
              },
              grid: {
                left: 60,
                right: 60,
                bottom: 20,
                containLabel: true
              },
              "backgroundColor": "rgba(0, 0, 0, 0)",
              dataZoom: {
                type: 'inside',
                zoomOnMouseWheel: true,
              },
              xAxis: {
                type: 'category',
                data: xdata,
              },
              yAxis: [{
                name: '仓下料量',
                type: 'value',
                splitLine: {
                  lineStyle: {
                    type: 'dotted',
                    //color: ['#aaa', '#ddd']
                  }
                },
                axisLabel: {
                  textStyle: {
                    color: '#000'
                  },
                },
                min: function (val) {
                  return parseInt(val.min - 20)
                },
                max: function (val) {
                  return parseInt(val.max + 20)
                },
              },],
              tooltip: {
                trigger: 'axis', //设置tip提示
                axisPointer: { // 坐标轴指示器，坐标轴触发有效
                  type: 'line' // 默认为直线，可选为：'line' | 'shadow'
                }
              },
              legend: {
                left: 'center',
              },
              series: series
            }
            chart.setOption(option, true)
          })
        })
      }
    },

    /** 查询料仓列表 */
    getList() {
      //this.loading = true
      pageSilo(this.queryParams).then(res => {
        this.silo2List = res.data.rows
        this.total = res.data.total
        this.loading = false
      })
    },
    // 取消按钮
    cancel() {
      this.open = false
      this.reset()
    },
    // 表单重置
    reset() {
      this.form = {
        siloId: null,
        siloCode: null,
        matterName: null,
        weightCode: null,
        cuttingCode: null,
        setCode: null,
        accudCode: null,
        accunCode: null,
        midCode: null,
        frequencyCode: null,
        totalCode: null,
        peibiCode: null,
        pianchaCode: null,
        preAdayCode: null,
      }
      this.resetForm('form')
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1
      this.getList()
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm('queryForm')
      this.handleQuery()
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.siloId)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    handleCut(row) {
      this.lz = false
      this.lcjll = false
      this.lljl = false
      this.xsjl = false
      this.plzl = false
      if (this.pbsdCut == true) {
        this.pbsdCut = false
      } else {
        this.pbsdCut = true
        this.draLczDataChartCut(row)
      }

    },
    handleWare(row) {
      this.siloItem = row
      if (this.lcjllWare == true) {
        this.lcjllWare = false
      } else {
        this.lcjllWare = true
        this.draLJwDataChartWare(row)
      }

    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset()
      this.open = true
      this.title = '添加料仓'
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset()
      const siloId = row.siloId || this.ids
      getSilo(siloId).then(res => {
        this.form = res.data
        this.open = true
        this.title = '修改料仓'
      })
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs['form'].validate(valid => {
        if (valid) {
          if (this.form.siloId != null) {
            updateSilo(this.form).then(res => {
              this.msgSuccess('修改成功')
              this.open = false
              this.getList()
            })
          } else {
            addSilo(this.form).then(res => {
              this.msgSuccess('新增成功')
              this.open = false
              this.getList()
            })
          }
        }
      })
    },
    /** 删除按钮操作 */
    // handleDelete(row) {
    //   const siloIds = row.siloId || this.ids
    //   this.$confirm('是否确认删除?', '警告', {
    //     confirmButtonText: '确定',
    //     cancelButtonText: '取消',
    //     type: 'warning'
    //   }).then(function () {
    //     return delSilo(siloIds)
    //   }).then(() => {
    //     this.getList()
    //     this.msgSuccess('删除成功')
    //   })
    // }
  }
}
</script>
<style lang="scss" scoped>
</style>
